import 'package:flutter/material.dart';

class Tab_ extends StatefulWidget {
  const Tab_({Key? key}) : super(key: key);

  @override
  State<Tab_> createState() => _Tab_State();
}

class _Tab_State extends State<Tab_> {
  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
        length: 3,
        child: Scaffold(
          appBar: AppBar(
            centerTitle: true,
            backgroundColor: Colors.black,
            title: Text('Tabs Demos'),
            bottom: TabBar(
              tabs: [
                SizedBox(
                  height: 30,
                  child: Text('关注'),
                ),
                SizedBox(
                  height: 30,
                  child: Text('推荐'),
                ),
                SizedBox(
                  height: 30,
                  child: Text('小时达'),
                ),
              ],
            ),
          ),
          body: TabBarView(
            children: [
              Tab(text: '关注',),
              Tab(text: '推荐',),
              Tab(text: '小时达'),
            ],
          ),
        )
    );
  }
}
